
<div class="content">
	<form method="post" action="">
	<div class="lookup">
		<label>Chọn tỉnh</label>
		<select name="lid">
			<?php foreach($locations as $k => $v):?>
			<option <?php echo(isset($lid) && $lid == $v->id ? 'selected="selected"' : '');?> value="<?php echo $v->id;?>"><?php echo $v->name;?></option>
			<?php endforeach;?>
		</select>
		<label>Chọn số ngày</label>
		<select name="days">
			<option <?php echo($days == 10 ? 'selected="selected"' : '');?> value="10">10</option>
			<option <?php echo($days == 20 ? 'selected="selected"' : '');?> value="20">20</option>
			<option <?php echo($days == 30 ? 'selected="selected"' : '');?> value="30">30</option>
		</select>
		</div>
		<button type="submit" class="box-css3"><span>Xem</span></button>
	</div>	
	</form>


	<?php 
	if($result):
	$max = $result->max;
	$min = $result->min;
	?>
	<div class="statis">
		<p class="txt-blue">Thống kê loto trong <?php echo $days;?> ngày </p>
		<div class="number">
			10 <span>Bộ số về</span> NHIỀU NHẤT
		</div>
		<div class="box clearfix">
			<div class="box-yelow mr10 left">
				<?php foreach($max as $k => $v):?>
				<?php if($k <= 4):?>
					<p <?php echo ($k==4 ? 'class="last"' : '');?>><?php echo $v[0]?>:(<?php echo $v[1];?> lần)</p>
				<?php endif;?>
				<?php endforeach;?>
			</div>
			<div class="box-yelow left">
				<?php foreach($max as $k => $v):?>
				<?php if($k >= 5):?>
					<p <?php echo ($k==4 ? 'class="last"' : '');?>><?php echo $v[0]?>:(<?php echo $v[1];?> lần)</p>
				<?php endif;?>
				<?php endforeach;?>
			</div>
		</div>
		<div class="number">
			10 <span>Bộ số về</span> ít NHẤT
		</div>
		<div class="box clearfix">	
			<div class="box-blue left mr10">
				<?php foreach($min as $k => $v):?>
				<?php if($k <= 4):?>
					<p <?php echo ($k==4 ? 'class="last"' : '');?>><?php echo $v[0]?>:(<?php echo $v[1];?> lần)</p>
				<?php endif;?>
				<?php endforeach;?>
			</div>
			<div class="box-blue left">
				<?php foreach($min as $k => $v):?>
				<?php if($k >= 5):?>
					<p <?php echo ($k==4 ? 'class="last"' : '');?>><?php echo $v[0]?>:(<?php echo $v[1];?> lần)</p>
				<?php endif;?>
				<?php endforeach;?>
			</div>
		</div>
	</div>
	<?php endif;?>
	
	<div class="bot-mobile clearfix">
		<div class="share">Chia sẻ cầu lên</div>
			<?php $this->load->view('client/layout/shared');?>
	</div>
</div>